﻿using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Web.Http;
using TP_API.Model;

namespace TP_API.Controllers
{
    public class userapiController : ApiController
    {
        [HttpPost]
        [HttpGet]
        public HttpResponseMessage newlogin()
        {
            try
            {
                ResultModel<newlogin> result = new ResultModel<newlogin>();

                result.status = 1;
                result.data=new newlogin();
                result.data.token = new Utility.ToMD5().MD5Encrypt("123456789");

                return new HttpResponseMessage()
                {
                    Content = new StringContent(JsonConvert.SerializeObject(result), Encoding.UTF8, "application/json"),
                };
            }
            catch (Exception ex)
            {
                return new HttpResponseMessage()
                {
                    Content = new StringContent("", Encoding.UTF8, "application/json"),
                };
            }
        }
    }
}